# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.File.V1.Model.NfsExportOptions do
  @moduledoc """
  NFS export options specifications.

  ## Attributes

  *   `accessMode` (*type:* `String.t`, *default:* `nil`) - Either READ_ONLY, for allowing only read requests on the exported directory, or READ_WRITE, for allowing both read and write requests. The default is READ_WRITE.
  *   `anonGid` (*type:* `String.t`, *default:* `nil`) - An integer representing the anonymous group id with a default value of 65534. Anon_gid may only be set with squash_mode of ROOT_SQUASH. An error will be returned if this field is specified for other squash_mode settings.
  *   `anonUid` (*type:* `String.t`, *default:* `nil`) - An integer representing the anonymous user id with a default value of 65534. Anon_uid may only be set with squash_mode of ROOT_SQUASH. An error will be returned if this field is specified for other squash_mode settings.
  *   `ipRanges` (*type:* `list(String.t)`, *default:* `nil`) - List of either an IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or CIDR ranges in the format `{octet1}.{octet2}.{octet3}.{octet4}/{mask size}` which may mount the file share. Overlapping IP ranges are not allowed, both within and across NfsExportOptions. An error will be returned. The limit is 64 IP ranges/addresses for each FileShareConfig among all NfsExportOptions.
  *   `squashMode` (*type:* `String.t`, *default:* `nil`) - Either NO_ROOT_SQUASH, for allowing root access on the exported directory, or ROOT_SQUASH, for not allowing root access. The default is NO_ROOT_SQUASH.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accessMode => String.t() | nil,
          :anonGid => String.t() | nil,
          :anonUid => String.t() | nil,
          :ipRanges => list(String.t()) | nil,
          :squashMode => String.t() | nil
        }

  field(:accessMode)
  field(:anonGid)
  field(:anonUid)
  field(:ipRanges, type: :list)
  field(:squashMode)
end

defimpl Poison.Decoder, for: GoogleApi.File.V1.Model.NfsExportOptions do
  def decode(value, options) do
    GoogleApi.File.V1.Model.NfsExportOptions.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.File.V1.Model.NfsExportOptions do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
